<%@ tag pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ attribute name="page" required="true" type="com.xunshibao.core.dao.page.Pagination" rtexprvalue="true"%>
<c:set var="total" value="${page.totalPage}" /><%-- 总页数 --%>
<c:set var="cur" value="${page.pageNo}"/><%-- 当前页 --%>
<c:if test="${cur + 5 < total}">
	<c:set var="total" value="${cur + 5}" />
	<c:set var="more" value="1"/>
</c:if>
<div class="page clearfix m15"><div class="page clearfix fr">
<p class="page_now clearfix">
<c:choose>
	<c:when test="${cur==1}"><a class="next" href="javascript:void(0);">第一页</a></c:when>
	<c:otherwise><a class="next" href="?pageNo=1">第一页</a></c:otherwise>
</c:choose>
<c:choose>
	<c:when test="${cur <= 6 && cur <= total}">
		<c:forEach begin="1" end="${total}" var="p">
			<c:choose>
				<c:when test="${p==cur}"><a class="current" href="javascript:void(0);">${p}</a></c:when>
				<c:otherwise><a href="?pageNo=${p}">${p}</a></c:otherwise>
			</c:choose>
		</c:forEach>
	</c:when>
	<c:when test="${cur > 6 &&  cur <= total}">
		<a href="?pageNo=1">1</a>
		<a href="?pageNo=2">2</a>
		<a href="javascript:void(0);">...</a>
		<c:forEach begin="${cur-2}" end="${total}" var="p">
			<c:choose>
				<c:when test="${p==cur}"><a class="current" href="javascript:void(0);">${p}</a></c:when>
				<c:otherwise><a href="?pageNo=${p}">${p}</a></c:otherwise>
			</c:choose>
		</c:forEach>
	</c:when>
</c:choose>
<c:if test="${more=='1'}"><a href="javascript:void(0);">...</a></c:if>
<c:choose>
	<c:when test="${page.lastPage}"><a class="down" href="javascript:void(0);">最末页</a></c:when>
	<c:otherwise><a class="down" href="?pageNo=${page.totalPage}">最末页</a></c:otherwise>
</c:choose>
<u>共${page.totalPage}页</u>
<u>到第<label><input type="text" id="numpage" name="numpage" class="numpage" value="1"></label>页</u>
</p>
<a onclick="this.href='?pageNo=' + $('#numpage').val();" class="at_but b_2_g" href="javascript:void(0)"><u></u>确定</a>
</div></div>
